home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / CW GUSI 1.6.4 / README < prev    next >
Text File  |  1995-11-06  |  22KB  |  497 lines

  1.                  G U S I -- Grand Unified Socket Interface
  2.  
  3. INTRODUCTION
  4.  
  5. GUSI is an extension and partial replacement of the standard C runtime library
  6. supplied with your compiler. Its main objective is to provide a more or less 
  7. simple and consistent interface across the following communication domains:
  8.  
  9. Files                Ordinary Macintosh files and MPW pseudo devices.
  10. Unix                Memory based communication within a single machine.
  11. Appletalk        ADSP communication over a network.
  12. PPC                Connections with the System 7 PPC Toolbox.
  13. Internet            TCP and UDP connections over MacTCP.
  14. PAP                 Connections to PostScript printers.
  15.  
  16. Additionally, GUSI adds some UNIX library calls dealing with files which were
  17. missing, like chdir(), getcwd(), symlink(), and readlink(), and changes a few
  18. other library calls to behave more like their POSIX counterparts.
  19.  
  20. REQUIREMENTS
  21.  
  22. To use GUSI with Metrowerks CodeWarrior, you need CW/5.5 or later. For the
  23. current version, you need CW/6.
  24.  
  25. COPYING
  26.  
  27. Copyright © 1992-1995 Matthias Neeracher
  28.  
  29. Permission is granted to anyone to use this software for any purpose on any
  30. computer system, and to redistribute it freely, subject to the following
  31. restrictions:
  32.  
  33. - The author is not responsible for the consequences of use of this software,
  34.   no matter how awful, even if they arise from defects in it.
  35. - The origin of this software must not be misrepresented, either by explicit
  36.   claim or by omission.
  37. - Altered versions must be plainly marked as such, and must not be misrepresented
  38.   as being the original software.
  39.  
  40. DOCUMENTATION
  41.  
  42. GUSI documentation is written in .pod format, a markup format used for Perl 5 
  43. documentation. From the .pod version, a HTML version for online documentation and
  44. an RTF version for hardcopy is generated. From the RTF Version, the PDF version
  45. is generated. Depending on packaging, the archive you received contains 
  46.  
  47. - A directory :pod: with the pod files.
  48. - A file GUSI.rtf with the RTF version.
  49. - A file GUSI.pdf with the PDF version.
  50.  
  51. WHERE TO BEGIN
  52.  
  53. You should probably start by looking at the documentation. Maybe
  54. it helps also to play with the sample programs.
  55.  
  56. BUGS, QUESTIONS, SUGGESTIONS
  57.  
  58. Please report any problems you experience with the code or the documentation to
  59. me. I'd also be interested in hearing about your success stories, if you have
  60. any.
  61.  
  62. GUSI ON WWW
  63.  
  64. An online version of the GUSI manual and a GUSI FAQ are available at 
  65. http://err.ethz.ch/members/neeri/macintosh.html
  66.  
  67. MAILING LIST
  68.  
  69. There is a mailing list for announcing new releases and discussions about 
  70. how to make GUSI change your life. To subscribe, send a mail:
  71.  
  72. ----------------------------------
  73. To: gusi-request@iis.ee.ethz.ch
  74. Subject: (is ignored)
  75.  
  76. subscribe
  77. ----------------------------------
  78.  
  79. Mail is now processed by a daemon, so please follow the above format.
  80.  
  81. Matthias Neeracher                    Office:    +41 1 445 24 08
  82. Hohenklingenstrasse 19                Fax:        +41 1 445 24 24
  83. 8049 Zuerich                            Home:     +41 1 341 85 06
  84. SWITZERLAND                                Email:    <neeri@iis.ee.ethz.ch>
  85.  
  86. RELEASE NOTES
  87.  
  88. Version 1.6.4        05Nov95
  89.  
  90. - Include experimental support for CFM68K. I don't have any 68K Macs for
  91.   testing, so this needs your feedback.
  92. - Be even more careful about alignment.
  93. - Avoid calling spin function from select immediately before returning
  94.   [Ray Johnson].
  95. - readlink() no longer mounts network volumes or floppies. This means that while the
  96.   result returned is identical, passing it to a file function might now fail in cases 
  97.   where it worked in earlier versions, but I think this version is much more 
  98.   useful overall [Martin Heller].
  99. - '*' at the end of a wildcard pattern now works.
  100.   
  101. Version 1.6.3        09Oct95
  102.  
  103. - Fixed alignment problems with new universal header version
  104.  
  105. Version 1.6.2        04Sep95
  106.  
  107. - Built with CodeWarrior 1.3 final instead of beta release
  108.  
  109. Version 1.6.1        26Aug95
  110.  
  111. - Version for CodeWarrior Integrated Environment 1.3
  112.  
  113. Version 1.6.0        25Aug95
  114.  
  115. - When opening the console fails, Dev:Null is now opened instead [Ray Johnson].
  116. - Added variant of TFileSpec::RelPath giving a relative path from an arbitrary
  117.   directory.
  118. - Made sure that not only open(), but also stat() works for the more common 
  119.   devices.
  120. - Files are now opened with HOpenDF instead of HOpen, which should get rid of
  121.   some embarassing crashes.
  122. - singletons are now reference counted correctly.
  123. - GUSIDispatchLib.68K contains a few more routines.
  124. - Fixed a disastrous bug in configuration resource parsing.
  125.   
  126. Version 1.5.9        25Jun95
  127.  
  128. - GUSI now makes more of an effort to handle volumes named Dev: [Ray Johnson].
  129. - Attacked a few problems occurring when GUSI was used from static initializers
  130.   [Paddy Benson].
  131. - Tried to assure that every struct declared in an external header is explicitely
  132.   declared with 68K alignment  [Paddy Benson].
  133. - Fixed a few more bugs in MPW tool support.
  134.  
  135. Version 1.5.8        05Jun95
  136.  
  137. - Changed C++ Style comment in sys/fcntl.h [Mark Roseman]
  138. - Included instructions for repairing dnr.c in "dnr.c Patch".
  139. - Introduced GUSIDispatch.Lib.68K, which is intended for use in single segment
  140.   links, in particular MPW tools. GUSIDispatch.Lib contains all functions that
  141.   absolutely *have* to be specified early in the link, so it suffices to include
  142.   GUSIDispatch.Lib early, and you can include GUSI.Lib later in the link. Unless
  143.   you're having "segment offset out of range" problems, you won't need this
  144.   library.
  145. - Included QUESTIONNAIRE. Please take the time to send in your response and
  146.   direct the further development of GUSI.
  147.  
  148. Version 1.5.7        04Jun95
  149.  
  150. - Fixed some incompatibilities with Metrowerks C++ 1.2.2 [David Tarabar and several
  151.   others].
  152. - Further increased TCP buffers [Alec Carlson].
  153.  
  154. Version 1.5.6     04May95
  155.  
  156. - sleep() had the termination condition wrong [Adam Skwersky].
  157. - GUSIDefaultSpin would interrupt a call if an unknown appleevent was sent 
  158.   [Brad Barber].
  159. - Every header which uses the "macintosh" preprocessor symbol now ensures that
  160.   it's defined properly.
  161.  
  162. Version 1.5.5        23Apr95
  163.  
  164. - Fixed creator of text files.
  165.  
  166. Version 1.5.5fc1    20Apr95
  167.  
  168. - Further error number reviewing.
  169. - Reactivated the AF_UNIX domain. It's actually a pretty fast family for simgle 
  170.   machine communication.
  171. - Added sleep(), usleep() and a relatively wimpy version of alarm().
  172. - Simplified segmentation scheme to avoid the horror accidents that happened
  173.   when people started renaming segments [Andrew Diseker].
  174. - Cleaned up conditional defines. Now I'm using GENERATINGPOWERPC, GENERATING68K
  175.   and GENERATINGCFM everywhere.
  176. - Include dnr.c directly so TCP/IP client programs no longer have to do that.
  177. - Fixed filename encoding.
  178. - Make select call post_selects before interrupting.
  179. - Make benchmark protocol used by bs/bc binary compatible with MPW version, no matter
  180.   how \n is set.
  181. - Fixed Mv and List in GUSIFileTest.c
  182. - Updated documentation.
  183.  
  184. Version 1.5.5b5    11Apr95
  185.  
  186. - Reviewed the error numbers returned and should now be much more compliant with
  187.   POSIX [Ray Johnson]. The documentation currently does not yet reflect these
  188.   changes.
  189. - Added files to the distribution that were forgotten in the previous version
  190.   [Various Correspondents].
  191. - Fixed guard define in netinet/in.h [Rolf-Stephan Badura].
  192. - The project stationeries had subtle and not so subtle errors [John Deighan].
  193. - Clarified the rebuilding instructions in README.CWGUSI [John Deighan].
  194.  
  195. Version 1.5.5b4 07Apr95
  196.  
  197. - Added MPW tool support.
  198. - Added access() and GUSI_ExecHook [Ray Johnson].
  199. - UDP sockets used to ignore packets sent to them before the first recv(); now they
  200.   start accepting packets right after bind().
  201. - Added PDF documentation [Ed Draper].
  202.  
  203. Version 1.5.5b3 21Mar95
  204.  
  205. - Improved SIOUX support [Patrick C. Beard].
  206. - access() would misbehave if a client closed immediately agfter connecting
  207.   [Jake Hill]
  208. - Provided updated documentation, now available in GUSI.rtf. See above regarding
  209.   an online version [Thanks to Martin Heller, who helped in several respects
  210.   with this project].
  211.  
  212. Version 1.5.5b2 26Jan95
  213.  
  214. - The inline assembly functions in the 68K versions would return values in the
  215.   wrong register.
  216. - Fixed segmentation of 68K completion routines.
  217. - Fixed interaction with SIOUX.
  218.  
  219. Version 1.5.5b1 25Jan95
  220.  
  221. - This is the first prerelease of the CodeWarrior port. See README.CW for what little
  222.   documentation there currently is on CWGUSI.
  223.   
  224. Version 1.5.0    31Dec94
  225.  
  226. - Port GUSI to the PowerPC. This has had the useful side effect of making the
  227.   source more portable to other compilers by eliminating some syntactic 
  228.   idiosyncrasies that MPW C was supporting and by moving the source to the 
  229.   universal headers.
  230. - Improve handling of filename oriented calls. All calls taking file names as
  231.   arguments are now fully dispatchable.
  232. - Move support for David Peterson's Inetd into a separate file. The bad news is
  233.   that you'll now have to explicitely request support for inetd, the good news
  234.   is that the majority of GUSI clients will have a somewhat smaller burden linked
  235.   in.
  236. - Added routines for encoding FSSpecs into printable C strings.
  237. - Fixed a horrible bug which would destroy certain path names on TFileSpec 
  238.   construction [John Liberty].
  239. - Increased the TCP buffer size and inserted process manager wakeups into TCP code,
  240.   both of which might improve performance; fixed a few more bugs in the TCP code
  241.   [Mark Lanett and Stephan Deibel].
  242. - Added documentation for TFileSpec.h
  243. - Added routines to the test code to test request/reply throughput.
  244. - Fixed a few minor bugs.
  245. - Added chmod(). The only part of its functionality that is supported is the 
  246.   ability to lock a file [John Kamp].
  247.   
  248. Version 1.4.1    02May94
  249.  
  250. - Non-blocking sends on TCP sockets with large amounts of data would not do
  251.   anything [Benjamin Beberness].
  252.  
  253. Version 1.4.0    01May94
  254.  
  255. - Enabled recvfrom with non-NULL from addresses on all stream socket families
  256.   (returning getpeername()) to fix a problem with MacPerl [James Burgess, 
  257.   Asa Packer].
  258. - Attempting to write on half open sockets would still sometimes hang because of
  259.   the fflush() problem mentioned below. I had to extend the kludge to almost
  260.   all possible error codes [Asa Packer].
  261. - Permissions returned by stat() for locked files were wrong [John Kamp].
  262. - Implemented utime() as far as possible (i.e., for modification times, the
  263.   Mac has no concept of access times) [James Burgess].
  264. - Another round in my epic battle with rename(): This time, rename() resolved
  265.   aliases that should have been left unresolved [Maki Watanabe, Man Wei Tam].
  266. - Avoided calls to malloc() on system startup to circumvent problems with 
  267.   MacPerl memory allocation [Sal Gurnani, Torsten Ekedahl et al.].
  268. - Try to behave more sensibly when the other side closes a socket() 
  269.   [David Hansen].
  270. - getservbyname() would fail unless /etc/services was in the preferences folder
  271.   [Alasdair Rawsthorne].
  272. - Switched from Projector to RCS.
  273. - Tried to fix a compatibility problem with MPW 3.2
  274.  
  275. Version 1.3.6  22Feb94
  276.  
  277. - recvfrom wouldn't return the address of the sender [Michael Wu].
  278. - TFileSpec constructors now preserve case, (hopefully) making rename("a","A")
  279.   finally work [Maki Watanabe].
  280. - rename() is now able to rename locked files. This is an experimental feature
  281.   introduced to support RCS. It might go away again.
  282.   
  283. Version 1.3.5    11Jan94
  284.  
  285. - Made the semantics of select() conform more closely to their UN*X counter-
  286.   parts. In particular, if there is no more data to read/write, a socket is 
  287.   now flagged as ready to read/write. In the past, the exception flag was 
  288.   incorrectly used to signal error conditions.
  289. - EBADF is now treated the same way as ESHUTDOWN on write().
  290. - GUSI now handles more than _NFILE stdio FILEs [James Tisdall].
  291. - Fixed several bugs with default arguments and prompts for choose() with 
  292.   files [Maki Watanabe].
  293. - chdir() would ignore most errors [Peter Lewis].
  294.  
  295. Version 1.3.4    17Nov93
  296.  
  297. - Fixed a bug in GUSIBuffer which prevented PPC Toolbox sockets from receiving
  298.   more than about 2K of data before crashing.
  299. - fflush() in the MPW stdio library doesn't take no (or -1) for an answer, 
  300.   therefore quitting with unsent data in the stdio buffers would cause programs 
  301.   to hang. As a workaround, GUSI detects when write() is called twice in a row 
  302.   and ESHUTDOWN would have been returned both times. In this case, GUSI pretends
  303.   the write succeeded the second time.
  304. - The new version of rename introduced in 1.3.3 was buggy in several respects.
  305.   First of all, it would return EINVAL when the call actually had succeeded. 
  306.   Second, rename() was too naive to actually force the correct spelling.
  307.   rename("a", "A"), would work, rename("A", "A"), when the file was actually
  308.   spelled "a" would not.
  309. - rmdir() frivolously walked up a directory before deleting, which for some
  310.   strange reason sometimes actually worked.
  311. - readdir() would return ENOENT when the end of the directory was reached, 
  312.   which is contrary to the way UN*X does it.
  313. - GUSI would try to open all network services whose socket families were 
  314.   linked  in at a very early stage in the application. This would cause 
  315.   problems for SLIP/PPP (and probably also ARA) users, as for some applications 
  316.   (like MacPerl), starting up SLIP every time made little sense. Additionally, 
  317.   initializing MacTCP before the rest of the Toolbox would cause crashes with 
  318.   some SLIP implementations. The behaviour of GUSI has now changed so network
  319.   services are only initialized when the first socket is opened or another call 
  320.   necessitates it.
  321. - A new socket family has been added in GUSIRemoteConole.o, which is currently 
  322.   not documented, so using it is not recommended.
  323.  
  324. Version 1.3.3    24Oct93
  325.  
  326. - Added automatic centering to get directory dialog if rezzed for System 7 only.
  327. - Added a constructor for special files and folders to class TFileSpec.
  328. - Made rename("a", "A") possible.
  329. - Made TFileSpec and consequently GUSI file routines more robust against 
  330.   pathological paths. Path components longer than 63 chars used to trash 
  331.   memory.
  332.  
  333. Version 1.3.2    11Sep93
  334.  
  335. - In the absence of an /etc/services file, endservent() tried to fclose 
  336.   (FILE *) -1, with disastrous consequences. Thanks to Olafur Bragason for
  337.   reporting this bug.
  338. - Paul C. Aitkenhead discovered that accept() for TCP sockets didn't fill
  339.   in the name of the connecting peer. 
  340. - The tests will now initialize QuickDraw by themselves, to take into account
  341.   the fact that when using SIOW, WaitNextEvent might get called before SIOW has
  342.   a chance to initialize the Toolbox.
  343. - As Brad Pickering found out, sends for UDP sockets would by mistake never 
  344.   report errors.
  345.  
  346. Version 1.3.1  09Aug93
  347.  
  348. - Reid Simmons brought to my attention that gethostname() was no longer an
  349.   external symbol. On closer inspection, the same turned out to be true about 
  350.   truncate() and GUSIDefaultSpin(). I had made a few mistakes in my prototypes.
  351.   The new version of the Internalize script should catch this type of error in
  352.   the future.
  353.   
  354. Version 1.3.0    31Jul93
  355.  
  356. - Separated examples into their own folder with their own Makefile. Building
  357.   GUSITest will therefore no longer cause GUSI.o to be rebuilt.
  358. - The Makefile has been generally sanitized. 
  359. - All header files now reside in :includes
  360. - Most headers have changed in rather drastical ways. The BSD headers are now
  361.   taken from net2 and are prototyped. This is initially likely to produce a 
  362.   few errors in your code where typecasts have been missing. In particular, the
  363.   following have changed:
  364.    - bind, connect, accept, and getsockname take address parameters 
  365.       of type (struct sockaddr *).
  366.     - If you had declard any variables as (dirent *), you will have to change 
  367.       that to (struct dirent *).
  368. - The headers have also been adapted so that no symbol from the standard MPW 
  369.   headers is ever redefined in an incompatible way (hopefully).
  370. - getserv...() has been enhanced, thanks to code contributed by Sak Wathanasin.
  371.   The new implementation first searches for a file /etc/services in the 
  372.   preferences folder, before falling back on the old approach.
  373. - getservent(), setervent(), endservent(), getservbyport(), truncate(), 
  374.   ftruncate(), and scandir() were added.
  375. - stat() on a directory now returns the number of files in st_size. Needless to
  376.   say, this is totally nonportable.
  377. - Pathnames where an intermediate folder existed as a file didn't give the
  378.   errors they should have given.
  379. - Another UDP fix.
  380.  
  381. Version 1.2.0    20Jun93
  382.  
  383. - Fixed a disastrous bug with configuration resources. MPW Tools that had no 
  384.   configuration resources would "borrow" resources of other Tools previously
  385.   loaded.
  386. - It is now possible to make the type & creator of newly created file dependent
  387.   on their suffixes (i.e., anything ening in .o can be mapped to 'OBJ '/'MPS ')
  388. - If socket creation fails due to low memory conditions, errno is set correctly
  389. - Opening of the console is now handled more subtly, allowing programmers to link
  390.   GUSI with their custom "Dev:Console" handlers.
  391. - The routine for checking for Command-period is now exported
  392. - getsockname() for UDP sockets in an early stage of their existence would in 
  393.   some cases nonsense. Thanks to Paul C. Aitkenhead for discovering.
  394. - Changed sa_constr_ppc. The old version was basically unable to provide a real
  395.   constraint. Hopefully, though, old sa_constr_ppc records are still handled
  396.   correctly.
  397. - Bracketed all headers defining prototypes with #ifdef __cplusplus 
  398.   incantations. Thanks to John W. Pope for suggesting this.
  399.   
  400. Version 1.1.1    04Apr93
  401.  
  402. - A few of the declarations in sys/fcntl.h were inconsistent with Fcntl.h and 
  403.   the actual behaviour of GUSI, in particular O_CREATE. (thanks to Franklin Chen 
  404.   for reporting).
  405. - PAP sockets would lose data when closed.
  406.  
  407. Version 1.1.0    14Mar93
  408.  
  409. - Reorganized the way to specify parts of GUSI to include. There are no 
  410.   specialized builds like GUSI_AFU.o anymore. Instead, you specify one or several 
  411.   configuration files in addition to GUSI.o in the link. If you just want to 
  412.   include everything possible, use {CLibraries}GUSI_Everything.cfg.
  413. - Added support for the Printer Access Protocol (PAP): You can open a connection
  414.   to the currently chosen LaserWriter with open("Dev:Printer").
  415. - Added support for Dave Peterson's forthcoming inetd.
  416. - Introduced fgetfileinfo().
  417. - All header files are now protected against multiple inclusion, as suggested by
  418.   J.T. Conklin.
  419. - st_nlink in statbufs used to return 1 for both files and folders. While it 
  420.   might be argued that this is true, it breaks some Unix programs. Therefore, 
  421.   the current version returns for folders either the number of items the folder 
  422.   contains + 2 or the number of subdirectories the folder contains + 2 (the 2 is 
  423.   an Unixism), depending on a flag in the configuration resource (thanks to 
  424.   Charlie Reiman for reporting).
  425. - fstat() used to claim that sockets were regular files. This bug had horrible 
  426.   consequences for some Unix software. Now, they correctly declare sockets to be
  427.   such.
  428. - Use FSpMakeFSSpec at some places in TFileSpec if it's available. Added a member
  429.   function Bless() to guarantee the kosherness of a TFileSpec.
  430. - Found a few severe bugs in GUSIBuffer. PPC sockets might work better now.
  431. - Added several new options to the preference resource. To specify which version 
  432.   of the preference resource you want, #define GUSI_PREF_VERSION to the version 
  433.   you want. If you don't, version '0102' is assumed.
  434. - To faciliate changing flags on the fly, programs rezzed with GUSI.r now include
  435.   a TMPL for the version resource.
  436.  
  437. Version 1.0.2    24Jan93
  438.  
  439. - rename() used to sometimes do the wrong thing if both the name and the folder 
  440.   had to be changed. I don't think the new version is 100% correct, but it 
  441.   should be better. (thanks to Brad Pickering for reporting)
  442. - choose() for files doesn't count the terminating NULL byte anymore. I hope 
  443.   nobody relied on the old version. (thanks again to Brad Pickering)
  444. - getserv...() and getprotoby...() used to return NULL for the aliases field, 
  445.   which is not correct.
  446. - TCP/IP sockets had a horrible bug with fast read/writes. That's what I get for
  447.   not doing my code stealing properly.
  448.  
  449. Version 1.0.1    09Jan93
  450.  
  451. - If a TCP socket returned from accept() was closed, further accepts on the
  452.   parent socket were disabled. Fixed. Thanks to Chen JiaTyan for reporting.
  453. - GUSI configuration resources are now respected
  454. - Programs linked with GUSI now by default automatically call the spin routine
  455.   for every read/write (This can be turned off in the configuration resource).
  456. - Add a chdir()-respecting fsetfileinfo()
  457.  
  458. Version 1.0        20Dec92
  459.  
  460. - Changed the way subset libraries were built.
  461. - Arrange for the GUSI_F variant to be always built.
  462. - Add routines to access FSSpec manipulations from plain C.
  463. - Add correct prototypes to netdb.h.
  464. - Rename GUSIFSp_P.h to TFileSpec.h and make it public.
  465. - Let choose() treat flags consistently for all address families: If CHOOSE_NEW
  466.   or CHOOSE_DIR are specified for a family that doesn't support them, EINVAL
  467.   is returned.
  468. - FileSocketDomain::choose() now treats CHOOSE_DEFAULT correctly
  469. - Add getcwd()
  470. - stat() now considers files with type 'TEXT' as executable (this is certainly
  471.   controversial and might be made configurable in a future version).
  472. - removed GUSIResident, the feature from hell. I forgot twice to specify
  473.   a resident segment for it, and both times it took me almost a week to find
  474.   the bug. The routines formerly in GUSIResident are now in Main.
  475. - fixed a few bugs.
  476. - Updated the documentation.
  477.  
  478. Version 1.0b4    29Oct92
  479.  
  480. Purged (hopefully) the last remaining traces of the obsolete structure name
  481. "direct" (should have been "dirent"). Thanks to Kevin Willey for pointing out
  482. that bug.
  483.  
  484. Version 1.0b3    19Oct92
  485.  
  486. Fixed a few bugs in the test programs
  487.  
  488. Version 1.0b2    05Oct92
  489.  
  490. The documentation is now almost complete.
  491.  
  492. Version 1.0b1    28Sep92
  493.  
  494. This release is somewhat premature. Although I believe the code is already in a
  495. decent shape, the documentation is still in a bad shape. I wouldn't trust the PPC
  496. Toolbox code too much yet.
  497.